package com.senlingspace.common.enums;

/**
 设备组队关联表 状态枚举
 */
public enum EqumentStatus {

    CREATE("CREATE", "等待中"),
    BROWSE("BROWSE", "体验中"),
    SUCCESS("SUCCESS", "已完成");

    private final String code;
    private final String description;

    EqumentStatus(String code, String description) {
        this.code = code;
        this.description = description;
    }

    public String getCode() {
        return code;
    }

    public String getDescription() {
        return description;
    }

    public static EqumentStatus fromCode(String code) {
        for (EqumentStatus status : EqumentStatus.values()) {
            if (status.getCode().equals(code)) {
                return status;
            }
        }
        throw new IllegalArgumentException("No enum constant with code " + code);
    }


    @Override
    public String toString() {
        return description;
    }
}
